$(function () {
   obj.init();
});
var obj = new function () {
    'use strict';
    return {
        form:null,
        dataGrid:null,
        init:function () {
            this.dataGrid = new xhDataGrid($('#list'),'feedback/getShieldList',{});
            this.dataGrid.parseToolbar().init().activeButton(['bt_list_unShield'],[]);
            this.listener();
            this.funObj().bindDgEvent();
        },
        listener:function () {
            var $this = this;
            //解除禁言
            $('#bt_list_unShield').click(function () {
                $this.funObj().unShield();
            });

            $('#bt_list_search').click(function () {
                $this.funObj().doSearch();
            })
        },
        funObj:function () {
            var $this = this;
            return {
                unShield:function () {
                    var userId = $this.dataGrid.getSelectValue('userId');
                    xhExtra.ajaxRequest('feedback/releaseShield',{userId:userId}, {}, function (res) {
                        window.top.xhTop.showSuccess(res.msg);
                        $this.dataGrid.reload();
                    })
                },
                bindDgEvent:function () {
                    $this.dataGrid.onDblClickRow = function (rowIndex,rowData) {

                    }
                },
                doSearch:function () {
                    $this.dataGrid.reload({
                        schoolId:xhExtra.getValue($('#select_schools')),
                        userName:xhExtra.getValue($('#list_search'))
                    });
                }
            }
        }
    }
};